﻿using System;

namespace HslCommunication.Profinet.Melsec
{
	/// <summary>
	/// 三菱PLC的数据类型，此处包含了几个常用的类型<br />
	/// Data types of Mitsubishi PLC, here contains several commonly used types
	/// </summary>
	// Token: 0x0200006F RID: 111
	public class MelsecMcDataType
	{
		/// <summary>
		/// 实例化一个三菱数据类型对象，如果您清楚类型代号，可以根据值进行扩展<br />
		/// Instantiate a Mitsubishi data type object, if you know the type code, you can expand according to the value
		/// </summary>
		/// <param name="code">数据类型的代号</param>
		/// <param name="type">0或1，默认为0</param>
		/// <param name="asciiCode">ASCII格式的类型信息</param>
		/// <param name="fromBase">指示地址的多少进制的，10或是16</param>
		// Token: 0x0600091F RID: 2335 RVA: 0x0003426C File Offset: 0x0003246C
		public MelsecMcDataType(byte code, byte type, string asciiCode, int fromBase)
		{
			this.DataCode = code;
			this.AsciiCode = asciiCode;
			this.FromBase = fromBase;
			bool flag = type < 2;
			if (flag)
			{
				this.DataType = type;
			}
		}

		/// <summary>
		/// 类型的代号值
		/// </summary>
		// Token: 0x1700018B RID: 395
		// (get) Token: 0x06000920 RID: 2336 RVA: 0x000342B8 File Offset: 0x000324B8
		// (set) Token: 0x06000921 RID: 2337 RVA: 0x000342C0 File Offset: 0x000324C0
		public byte DataCode { get; private set; } = 0;

		/// <summary>
		/// 数据的类型，0代表按字，1代表按位
		/// </summary>
		// Token: 0x1700018C RID: 396
		// (get) Token: 0x06000922 RID: 2338 RVA: 0x000342C9 File Offset: 0x000324C9
		// (set) Token: 0x06000923 RID: 2339 RVA: 0x000342D1 File Offset: 0x000324D1
		public byte DataType { get; private set; } = 0;

		/// <summary>
		/// 当以ASCII格式通讯时的类型描述
		/// </summary>
		// Token: 0x1700018D RID: 397
		// (get) Token: 0x06000924 RID: 2340 RVA: 0x000342DA File Offset: 0x000324DA
		// (set) Token: 0x06000925 RID: 2341 RVA: 0x000342E2 File Offset: 0x000324E2
		public string AsciiCode { get; private set; }

		/// <summary>
		/// 指示地址是10进制，还是16进制的
		/// </summary>
		// Token: 0x1700018E RID: 398
		// (get) Token: 0x06000926 RID: 2342 RVA: 0x000342EB File Offset: 0x000324EB
		// (set) Token: 0x06000927 RID: 2343 RVA: 0x000342F3 File Offset: 0x000324F3
		public int FromBase { get; private set; }

		/// <summary>
		/// X输入继电器
		/// </summary>
		// Token: 0x0400022E RID: 558
		public static readonly MelsecMcDataType X = new MelsecMcDataType(156, 1, "X*", 16);

		/// <summary>
		/// Y输出继电器
		/// </summary>
		// Token: 0x0400022F RID: 559
		public static readonly MelsecMcDataType Y = new MelsecMcDataType(157, 1, "Y*", 16);

		/// <summary>
		/// M内部继电器
		/// </summary>
		// Token: 0x04000230 RID: 560
		public static readonly MelsecMcDataType M = new MelsecMcDataType(144, 1, "M*", 10);

		/// <summary>
		/// SM特殊继电器
		/// </summary>
		// Token: 0x04000231 RID: 561
		public static readonly MelsecMcDataType SM = new MelsecMcDataType(145, 1, "SM", 10);

		/// <summary>
		/// S步进继电器
		/// </summary>
		// Token: 0x04000232 RID: 562
		public static readonly MelsecMcDataType S = new MelsecMcDataType(152, 1, "S*", 10);

		/// <summary>
		/// L锁存继电器
		/// </summary>
		// Token: 0x04000233 RID: 563
		public static readonly MelsecMcDataType L = new MelsecMcDataType(146, 1, "L*", 10);

		/// <summary>
		/// F报警器
		/// </summary>
		// Token: 0x04000234 RID: 564
		public static readonly MelsecMcDataType F = new MelsecMcDataType(147, 1, "F*", 10);

		/// <summary>
		/// V边沿继电器
		/// </summary>
		// Token: 0x04000235 RID: 565
		public static readonly MelsecMcDataType V = new MelsecMcDataType(148, 1, "V*", 10);

		/// <summary>
		/// B链接继电器
		/// </summary>
		// Token: 0x04000236 RID: 566
		public static readonly MelsecMcDataType B = new MelsecMcDataType(160, 1, "B*", 16);

		/// <summary>
		/// SB特殊链接继电器
		/// </summary>
		// Token: 0x04000237 RID: 567
		public static readonly MelsecMcDataType SB = new MelsecMcDataType(161, 1, "SB", 16);

		/// <summary>
		/// DX直接访问输入
		/// </summary>
		// Token: 0x04000238 RID: 568
		public static readonly MelsecMcDataType DX = new MelsecMcDataType(162, 1, "DX", 16);

		/// <summary>
		/// DY直接访问输出
		/// </summary>
		// Token: 0x04000239 RID: 569
		public static readonly MelsecMcDataType DY = new MelsecMcDataType(163, 1, "DY", 16);

		/// <summary>
		/// D数据寄存器
		/// </summary>
		// Token: 0x0400023A RID: 570
		public static readonly MelsecMcDataType D = new MelsecMcDataType(168, 0, "D*", 10);

		/// <summary>
		/// 特殊链接存储器
		/// </summary>
		// Token: 0x0400023B RID: 571
		public static readonly MelsecMcDataType SD = new MelsecMcDataType(169, 0, "SD", 10);

		/// <summary>
		/// W链接寄存器
		/// </summary>
		// Token: 0x0400023C RID: 572
		public static readonly MelsecMcDataType W = new MelsecMcDataType(180, 0, "W*", 16);

		/// <summary>
		/// SW特殊链接寄存器
		/// </summary>
		// Token: 0x0400023D RID: 573
		public static readonly MelsecMcDataType SW = new MelsecMcDataType(181, 0, "SW", 16);

		/// <summary>
		/// R文件寄存器
		/// </summary>
		// Token: 0x0400023E RID: 574
		public static readonly MelsecMcDataType R = new MelsecMcDataType(175, 0, "R*", 10);

		/// <summary>
		/// 变址寄存器
		/// </summary>
		// Token: 0x0400023F RID: 575
		public static readonly MelsecMcDataType Z = new MelsecMcDataType(204, 0, "Z*", 10);

		/// <summary>
		/// 文件寄存器ZR区
		/// </summary>
		// Token: 0x04000240 RID: 576
		public static readonly MelsecMcDataType ZR = new MelsecMcDataType(176, 0, "ZR", 10);

		/// <summary>
		/// 定时器的当前值
		/// </summary>
		// Token: 0x04000241 RID: 577
		public static readonly MelsecMcDataType TN = new MelsecMcDataType(194, 0, "TN", 10);

		/// <summary>
		/// 定时器的触点
		/// </summary>
		// Token: 0x04000242 RID: 578
		public static readonly MelsecMcDataType TS = new MelsecMcDataType(193, 1, "TS", 10);

		/// <summary>
		/// 定时器的线圈
		/// </summary>
		// Token: 0x04000243 RID: 579
		public static readonly MelsecMcDataType TC = new MelsecMcDataType(192, 1, "TC", 10);

		/// <summary>
		/// 累计定时器的触点
		/// </summary>
		// Token: 0x04000244 RID: 580
		public static readonly MelsecMcDataType SS = new MelsecMcDataType(199, 1, "SS", 10);

		/// <summary>
		/// 累计定时器的线圈
		/// </summary>
		// Token: 0x04000245 RID: 581
		public static readonly MelsecMcDataType SC = new MelsecMcDataType(198, 1, "SC", 10);

		/// <summary>
		/// 累计定时器的当前值
		/// </summary>
		// Token: 0x04000246 RID: 582
		public static readonly MelsecMcDataType SN = new MelsecMcDataType(200, 0, "SN", 100);

		/// <summary>
		/// 计数器的当前值
		/// </summary>
		// Token: 0x04000247 RID: 583
		public static readonly MelsecMcDataType CN = new MelsecMcDataType(197, 0, "CN", 10);

		/// <summary>
		/// 计数器的触点
		/// </summary>
		// Token: 0x04000248 RID: 584
		public static readonly MelsecMcDataType CS = new MelsecMcDataType(196, 1, "CS", 10);

		/// <summary>
		/// 计数器的线圈
		/// </summary>
		// Token: 0x04000249 RID: 585
		public static readonly MelsecMcDataType CC = new MelsecMcDataType(195, 1, "CC", 10);

		/// <summary>
		/// X输入继电器
		/// </summary>
		// Token: 0x0400024A RID: 586
		public static readonly MelsecMcDataType Keyence_X = new MelsecMcDataType(156, 1, "X*", 16);

		/// <summary>
		/// Y输出继电器
		/// </summary>
		// Token: 0x0400024B RID: 587
		public static readonly MelsecMcDataType Keyence_Y = new MelsecMcDataType(157, 1, "Y*", 16);

		/// <summary>
		/// 链接继电器
		/// </summary>
		// Token: 0x0400024C RID: 588
		public static readonly MelsecMcDataType Keyence_B = new MelsecMcDataType(160, 1, "B*", 16);

		/// <summary>
		/// 内部辅助继电器
		/// </summary>
		// Token: 0x0400024D RID: 589
		public static readonly MelsecMcDataType Keyence_M = new MelsecMcDataType(144, 1, "M*", 10);

		/// <summary>
		/// 锁存继电器
		/// </summary>
		// Token: 0x0400024E RID: 590
		public static readonly MelsecMcDataType Keyence_L = new MelsecMcDataType(146, 1, "L*", 10);

		/// <summary>
		/// 控制继电器
		/// </summary>
		// Token: 0x0400024F RID: 591
		public static readonly MelsecMcDataType Keyence_SM = new MelsecMcDataType(145, 1, "SM", 10);

		/// <summary>
		/// 控制存储器
		/// </summary>
		// Token: 0x04000250 RID: 592
		public static readonly MelsecMcDataType Keyence_SD = new MelsecMcDataType(169, 0, "SD", 10);

		/// <summary>
		/// 数据存储器
		/// </summary>
		// Token: 0x04000251 RID: 593
		public static readonly MelsecMcDataType Keyence_D = new MelsecMcDataType(168, 0, "D*", 10);

		/// <summary>
		/// 文件寄存器
		/// </summary>
		// Token: 0x04000252 RID: 594
		public static readonly MelsecMcDataType Keyence_R = new MelsecMcDataType(175, 0, "R*", 10);

		/// <summary>
		/// 文件寄存器
		/// </summary>
		// Token: 0x04000253 RID: 595
		public static readonly MelsecMcDataType Keyence_ZR = new MelsecMcDataType(176, 0, "ZR", 10);

		/// <summary>
		/// 链路寄存器
		/// </summary>
		// Token: 0x04000254 RID: 596
		public static readonly MelsecMcDataType Keyence_W = new MelsecMcDataType(180, 0, "W*", 16);

		/// <summary>
		/// 计时器（当前值）
		/// </summary>
		// Token: 0x04000255 RID: 597
		public static readonly MelsecMcDataType Keyence_TN = new MelsecMcDataType(194, 0, "TN", 10);

		/// <summary>
		/// 计时器（接点）
		/// </summary>
		// Token: 0x04000256 RID: 598
		public static readonly MelsecMcDataType Keyence_TS = new MelsecMcDataType(193, 1, "TS", 10);

		/// <summary>
		/// 计时器（线圈）
		/// </summary>
		// Token: 0x04000257 RID: 599
		public static readonly MelsecMcDataType Keyence_TC = new MelsecMcDataType(192, 1, "TC", 10);

		/// <summary>
		/// 计数器（当前值）
		/// </summary>
		// Token: 0x04000258 RID: 600
		public static readonly MelsecMcDataType Keyence_CN = new MelsecMcDataType(197, 0, "CN", 10);

		/// <summary>
		/// 计数器（接点）
		/// </summary>
		// Token: 0x04000259 RID: 601
		public static readonly MelsecMcDataType Keyence_CS = new MelsecMcDataType(196, 1, "CS", 10);

		/// <summary>
		/// 计数器（线圈）
		/// </summary>
		// Token: 0x0400025A RID: 602
		public static readonly MelsecMcDataType Keyence_CC = new MelsecMcDataType(195, 1, "CC", 10);

		/// <summary>
		/// 输入继电器
		/// </summary>
		// Token: 0x0400025B RID: 603
		public static readonly MelsecMcDataType Panasonic_X = new MelsecMcDataType(156, 1, "X*", 10);

		/// <summary>
		/// 输出继电器
		/// </summary>
		// Token: 0x0400025C RID: 604
		public static readonly MelsecMcDataType Panasonic_Y = new MelsecMcDataType(157, 1, "Y*", 10);

		/// <summary>
		/// 链接继电器
		/// </summary>
		// Token: 0x0400025D RID: 605
		public static readonly MelsecMcDataType Panasonic_L = new MelsecMcDataType(160, 1, "L*", 10);

		/// <summary>
		/// 内部继电器
		/// </summary>
		// Token: 0x0400025E RID: 606
		public static readonly MelsecMcDataType Panasonic_R = new MelsecMcDataType(144, 1, "R*", 10);

		/// <summary>
		/// 数据存储器
		/// </summary>
		// Token: 0x0400025F RID: 607
		public static readonly MelsecMcDataType Panasonic_DT = new MelsecMcDataType(168, 0, "D*", 10);

		/// <summary>
		/// 链接存储器
		/// </summary>
		// Token: 0x04000260 RID: 608
		public static readonly MelsecMcDataType Panasonic_LD = new MelsecMcDataType(180, 0, "W*", 10);

		/// <summary>
		/// 计时器（当前值）
		/// </summary>
		// Token: 0x04000261 RID: 609
		public static readonly MelsecMcDataType Panasonic_TN = new MelsecMcDataType(194, 0, "TN", 10);

		/// <summary>
		/// 计时器（接点）
		/// </summary>
		// Token: 0x04000262 RID: 610
		public static readonly MelsecMcDataType Panasonic_TS = new MelsecMcDataType(193, 1, "TS", 10);

		/// <summary>
		/// 计数器（当前值）
		/// </summary>
		// Token: 0x04000263 RID: 611
		public static readonly MelsecMcDataType Panasonic_CN = new MelsecMcDataType(197, 0, "CN", 10);

		/// <summary>
		/// 计数器（接点）
		/// </summary>
		// Token: 0x04000264 RID: 612
		public static readonly MelsecMcDataType Panasonic_CS = new MelsecMcDataType(196, 1, "CS", 10);

		/// <summary>
		/// 特殊链接继电器
		/// </summary>
		// Token: 0x04000265 RID: 613
		public static readonly MelsecMcDataType Panasonic_SM = new MelsecMcDataType(145, 1, "SM", 10);

		/// <summary>
		/// 特殊链接存储器
		/// </summary>
		// Token: 0x04000266 RID: 614
		public static readonly MelsecMcDataType Panasonic_SD = new MelsecMcDataType(169, 0, "SD", 10);
	}
}
